'
该场景为局外升级的界面
'

extends CanvasLayer

@export var upgrades: Array[ExternalUpgrade] = []#局外能力数组

@onready var grid_container: GridContainer = %GridContainer

var external_upgrade_card = preload("res://场景/ui组件/局外升级卡片.tscn")

#将局外能力数组中的全部成员实例化
func _ready() -> void:
	%BackButton.pressed.connect(on_back_pressed)
	for upgrade in upgrades:
		var external_upgrade_card_instance = external_upgrade_card.instantiate()
		grid_container.add_child(external_upgrade_card_instance)
		external_upgrade_card_instance.set_external_upgrade(upgrade)
	pass

#返回主菜单
func on_back_pressed() -> void:
	ScreenTransition.change_screen("res://场景/ui/主菜单.tscn")
	pass
